<?php

/* --------------------------------------------------------------
   $Id: new_product.php,v 1.1 2010/09/08 10:50:55 akausch Exp $

   XT-Commerce - community made shopping
   http://www.xt-commerce.com

   Copyright (c) 2009 commerce:SEO ein Projekt von Webdesign Erfurt
   --------------------------------------------------------------
   based on:
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(categories.php,v 1.140 2003/03/24); www.oscommerce.com
   (c) 2003  nextcommerce (categories.php,v 1.37 2003/08/18); www.nextcommerce.org
   (c) 2008 XT-Commerce

   Released under the GNU General Public License
   --------------------------------------------------------------
   Third Party contribution:
   Enable_Disable_Categories 1.3               Autor: Mikel Williams | mikel@ladykatcostumes.com
   New Attribute Manager v4b                   Autor: Mike G | mp3man@internetwork.net | http://downloads.ephing.com
   Category Descriptions (Version: 1.5 MS2)    Original Author:   Brian Lowe <blowe@wpcusrgrp.org> | Editor: Lord Illicious <shaolin-venoms@illicious.net>
   Customers Status v3.x  (c) 2002-2003 Copyright Elari elari@free.fr | www.unlockgsm.com/dload-osc/ | CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/elari/?sortby=date#dirlist

   Released under the GNU General Public License
   --------------------------------------------------------------*/

if (($_GET['pID']) && (!$_POST)) {
	$product_query = xtc_db_query("select *, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available 
	                               from ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd
                                  where p.products_id = '".(int) $_GET['pID']."'
                                  and p.products_id = pd.products_id
                                  and pd.language_id = '".$_SESSION['languages_id']."'");

	$product = xtc_db_fetch_array($product_query);
	$pInfo = new objectInfo($product);

}
elseif ($_POST) {
	$pInfo = new objectInfo($_POST);
	$products_name = $_POST['products_name'];
	$products_description = $_POST['products_description'];
	$products_short_description = $_POST['products_short_description'];
	$products_zusatz_description = $_POST['products_zusatz_description'];
	$products_keywords = $_POST['products_keywords'];
	$products_meta_title = $_POST['products_meta_title'];
	$products_meta_description = $_POST['products_meta_description'];
	$products_meta_keywords = $_POST['products_meta_keywords'];
	$products_tag_cloud = $_POST['$products_tag_cloud'];
	$products_url = $_POST['products_url'];
	$pInfo->products_startpage = $_POST['products_startpage'];
   $products_startpage_sort = $_POST['products_startpage_sort'];
} else {
	$pInfo = new objectInfo(array());
}

$manufacturers_array = array(array ('id' => '', 'text' => TEXT_NONE));
$manufacturers_query = xtc_db_query("select manufacturers_id, manufacturers_name from ".TABLE_MANUFACTURERS." order by manufacturers_name");
while ($manufacturers = xtc_db_fetch_array($manufacturers_query)) {
	$manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
}

$vpe_array = array(array('id' => '', 'text' => TEXT_NONE));
$vpe_query = xtc_db_query("select products_vpe_id, products_vpe_name from ".TABLE_PRODUCTS_VPE." WHERE language_id='".$_SESSION['languages_id']."' order by products_vpe_name");
while ($vpe = xtc_db_fetch_array($vpe_query)) {
	$vpe_array[] = array('id' => $vpe['products_vpe_id'], 'text' => $vpe['products_vpe_name']);
}

$tax_class_array = array(array ('id' => '0', 'text' => TEXT_NONE));
$tax_class_query = xtc_db_query("select tax_class_id, tax_class_title from ".TABLE_TAX_CLASS." order by tax_class_title");
while ($tax_class = xtc_db_fetch_array($tax_class_query)) {
	$tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']);
}

$conditions = array(array ('id' => 'neu', 'text' => 'Neu'));
$conditions[] = array('id' => 'gebraucht', 'text' => 'Gebraucht');
$conditions[] = array('id' => 'erneuert', 'text' => 'Erneuert');

$shipping_statuses = array ();
$shipping_statuses = xtc_get_shipping_status();
$languages = xtc_get_languages();

switch ($pInfo->products_status) {
	case '0' :
		$status = false;
		$out_status = true;
		break;
	case '1' :
	default :
		$status = true;
		$out_status = false;
}

if ($pInfo->products_startpage == '1') { 
	$startpage_checked = true; 
} else { 
	$startpage_checked = false; 
}
if ($pInfo->products_cartspecial == '1') { 
	$cartspecial_checked = true; 
} else { 
	$cartspecial_checked = false; 
}


?>
<link rel="stylesheet" type="text/css" href="includes/javascript/spiffyCal/spiffyCal_v2_1.css">
<script type="text/javascript" src="includes/javascript/spiffyCal/spiffyCal_v2_1.js"></script>
<link type="text/css" rel="stylesheet" href="includes/javascript/tabpane/css/luna/tab.css" />
<script type="text/javascript" src="includes/javascript/tabpane/js/tabpane.js"></script>
<script type="text/javascript" src="includes/javascript/tooltip.js"></script>
<script type="text/javascript" src="includes/javascript/ui/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="includes/javascript/ui/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="includes/javascript/ui/jquery.ui.tabs.min.js"></script>
<link rel="stylesheet" href="includes/javascript/ui/css/cseo/jquery-ui-1.8.1.custom.css" type="text/css" media="print, projection, screen">
<link rel="stylesheet" href="includes/javascript/tabs/jquery.tabs.css" type="text/css" media="print, projection, screen">
<!--[if lte IE 7]>
<link rel="stylesheet" href="includes/javascript/tabs/jquery.tabs-ie.css" type="text/css" media="projection, screen">
<![endif]-->
<script type="text/javascript">
	jQuery(function() {
		jQuery('#tabs').tabs({ fx: { opacity: 'toggle' } });
	});
</script>

<script type="text/javascript">
  var dateAvailable = new ctlSpiffyCalendarBox("dateAvailable", "new_product", "products_date_available","btnDate1","<?php echo $pInfo->products_date_available; ?>",scBTNMODE_CUSTOMBLUE);
</script>

<tr><td>

	<table class="table_pageHeading" border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
     <td class="pageHeading">
        <?php echo sprintf(TEXT_NEW_PRODUCT, xtc_output_generated_category_path($current_category_id)); ?>
     </td>
   </tr>
   </table>
      
<?php $form_action = ($_GET['pID']) ? 'update_product' : 'insert_product';
 $fsk18_array=array(array('id'=>0,'text'=>NO),array('id'=>1,'text'=>YES)); 
 echo xtc_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $_GET['cPath'] . '&pID=' . $_GET['pID'] . '&action='.$form_action . '#pID='.$_GET['pID'], 'post', 'enctype="multipart/form-data"'); ?>

<div align="right" style="display:block; text-align:right">
	<input type="submit" class="button" value="<?php echo BUTTON_SAVE; ?>">
  	&nbsp;&nbsp;
  	<?php echo '<a class="button" href="' . xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['pID']) . '">' . BUTTON_CANCEL . '</a>'; ?>
</div>
<h3>Grundeinstellungen</h3>
<table width="100%"  border="0">
  <tr>
    <td valign="top" width="50%">		    
    	<table width="100%"  border="0">
	    <tr>
	        <td nowrap="nowrap" class="main"><?php echo TEXT_PRODUCTS_STARTPAGE; ?> <?php echo TEXT_PRODUCTS_STARTPAGE_YES . xtc_draw_radio_field('products_startpage', '1', $startpage_checked) . '&nbsp;' . TEXT_PRODUCTS_STARTPAGE_NO . xtc_draw_radio_field('products_startpage', '0', !$startpage_checked) ?></td>
	        <td class="main"><?php echo TEXT_PRODUCTS_STARTPAGE_SORT; ?>&nbsp;<?php echo  xtc_draw_input_field('products_startpage_sort', $pInfo->products_startpage_sort ,'size=3'); ?></td>
	    </tr>
		<tr>   
			<td class="main"><?php echo TEXT_PRODUCTS_CART_SPECIALS; ?> <?php echo TEXT_PRODUCTS_STARTPAGE_YES . xtc_draw_radio_field('products_cartspecial', '1', $cartspecial_checked) . '&nbsp;' . TEXT_PRODUCTS_STARTPAGE_NO . xtc_draw_radio_field('products_cartspecial', '0', !$cartspecial_checked) ?></td>
			<td class="main">&nbsp;</td>
		</tr>
 	    <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_SORT; ?>&nbsp;<?php echo  xtc_draw_input_field('products_sort', $pInfo->products_sort,'size=3'); ?></td>
	        <td class="main"><?php echo TEXT_PRODUCTS_QUANTITY; ?>&nbsp;<?php echo xtc_draw_input_field('products_quantity', $pInfo->products_quantity,'size=5'); ?></td>
	         
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_MODEL; ?></td>
	        <td class="main"><?php echo  xtc_draw_input_field('products_model', $pInfo->products_model); ?></td>
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURERS_MODEL; ?></td>
	        <td class="main"><?php echo  xtc_draw_input_field('products_manufacturers_model', $pInfo->products_manufacturers_model); ?></td>
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_EAN; ?></td>
	        <td class="main"><?php echo  xtc_draw_input_field('products_ean', $pInfo->products_ean); ?></td>
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_MANUFACTURER; ?></td>
	        <td class="main"><?php echo xtc_draw_pull_down_menu('manufacturers_id', $manufacturers_array, $pInfo->manufacturers_id); ?></td>
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_PRODUCTS_VPE_VISIBLE.' '.xtc_draw_selection_field('products_vpe_status', 'checkbox', '1',$pInfo->products_vpe_status==1 ? true : false); ?>
	        <?php echo TEXT_PRODUCTS_VPE_VALUE.xtc_draw_input_field('products_vpe_value', $pInfo->products_vpe_value,'size=4'); ?></td>
	        <td class="main"><?php echo TEXT_PRODUCTS_VPE. xtc_draw_pull_down_menu('products_vpe', $vpe_array, $pInfo->products_vpe='' ?  DEFAULT_PRODUCTS_VPE_ID : $pInfo->products_vpe); ?></td>
	      </tr>
	      <tr>
	        <td class="main"><?php echo TEXT_FSK18; ?>&nbsp;<?php echo xtc_draw_pull_down_menu('fsk18', $fsk18_array, $pInfo->products_fsk18); ?></td>
	        <td class="main"><?php echo TEXT_PRODUCTS_WEIGHT; ?><?php echo xtc_draw_input_field('products_weight', $pInfo->products_weight,'size=4'); ?><?php echo TEXT_PRODUCTS_WEIGHT_INFO; ?></td>
	      </tr>
		<?php if (ACTIVATE_SHIPPING_STATUS=='true') { ?>
			<tr>
	        <td class="main"><?php echo BOX_SHIPPING_STATUS.':'; ?></td>
	        <td class="main"><?php echo xtc_draw_pull_down_menu('shipping_status', $shipping_statuses, DEFAULT_SHIPPING_STATUS_ID, $pInfo->products_shippingtime); ?></td>
	      </tr>
		<?php } ?>
		<tr>
			<td class="main"><?php echo TEXT_PRODUCTS_ZUSTAND; ?></td>
	        <td class="main"><?php echo xtc_draw_pull_down_menu('products_zustand', $conditions, $pInfo->products_zustand); ?></td>
		</tr>
      <tr>
          <?php
			$files = array ();
			if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_info/')) {
				while (($file = readdir($dir)) !== false) {
					if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_info/'.$file) and ($file != "index.html")) {
						$files[] = array ('id' => $file, 'text' => $file);
					} //if
				} // while
				closedir($dir);
			}
			$default_array = array ();
			// set default value in dropdown!
			if ($content['content_file'] == '') {
				$default_array[] = array ('id' => 'default', 'text' => TEXT_SELECT);
				$default_value = $pInfo->product_template;
				$files = array_merge($default_array, $files);
			} else {
				$default_array[] = array ('id' => 'default', 'text' => TEXT_NO_FILE);
				$default_value = $pInfo->product_template;
				$files = array_merge($default_array, $files);
			}
			echo '<td class="main">'.TEXT_CHOOSE_INFO_TEMPLATE.':</td>';
			echo '<td class="main">'.xtc_draw_pull_down_menu('info_template', $files, $default_value).'</td>';
			?>
      </tr>
      <tr>
          <?php
			$files = array();
			if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_options/')) {
				while (($file = readdir($dir)) !== false) {
					if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_options/'.$file) and ($file != "index.html")) {
						$files[] = array ('id' => $file, 'text' => $file);
					} //if
				} // while
				closedir($dir);
			}
			// set default value in dropdown!
			$default_array = array ();
			if ($content['content_file'] == '') {
				$default_array[] = array ('id' => 'default', 'text' => TEXT_SELECT);
				$default_value = $pInfo->options_template;
				$files = array_merge($default_array, $files);
			} else {
				$default_array[] = array ('id' => 'default', 'text' => TEXT_NO_FILE);
				$default_value = $pInfo->options_template;
				$files = array_merge($default_array, $files);
			}
			echo '<td class="main">'.TEXT_CHOOSE_OPTIONS_TEMPLATE.':'.'</td>';
			echo '<td class="main">'.xtc_draw_pull_down_menu('options_template', $files, $default_value).'</td>';
			?>
      </tr>
		<tr>
			<td class="main" valign="top">
				<?php echo TEXT_PAYMENT_METHOD; ?> <?php echo'<a href="#" onclick="javascript:return false;"'.mouseOverJS(TEXT_PAYMENT_METHOD,PAYMENT_METHOD_TAG).'>'.xtc_image(DIR_WS_ICONS.'icon_help.gif').'</a>'; ?>
			</td>
			<td>
				<table width="100%">
					<?php
					$modulepayment_value = xtc_db_fetch_array(xtc_db_query("select configuration_value FROM configuration WHERE configuration_key = 'MODULE_PAYMENT_INSTALLED'"));
					$modulepayment_value = explode(';', $modulepayment_value['configuration_value']);
					
					$zahlarten = explode('|', $pInfo->products_forbidden_payment);
				
					foreach($modulepayment_value AS $payment) {
											
						include(DIR_FS_LANGUAGES . $_SESSION['language'] . '/modules/payment/' . $payment); 
						$payment_title = constant(strtoupper('MODULE_PAYMENT_'.str_replace('.php', '', $payment).'_TEXT_TITLE'));
											
						echo '<tr>
								<td class="main">'.$payment_title.'</td>
								<td class="main">'.xtc_draw_selection_field('forbidden_payment[]', 'checkbox', $payment, (in_array($payment, $zahlarten) ? true : false)).'</td> 
								</tr>';
					}
					?>
				</table>
			</td>
		</tr>	  
		<tr>
			<td class="main" valign="top">
				<table width="100%">
					<tr>
						<td align="left" valign="top">
							<?php echo TEXT_TEMPLATE_COLUMN; ?> <?php echo'<a href="#" onclick="javascript:return false;"'.mouseOverJS(TEXT_TEMPLATE_COLUMN,TEMPLATE_METHOD_TAG).'>'.xtc_image(DIR_WS_ICONS.'icon_help.gif').'</a>'; ?>
						</td>
						<td align="right">
							<?php echo xtc_image('images/template_prod.gif', 'Produkt Detail' , 'align="right"'); ?></td>
						</td>
					</tr>
				</table>
			</td>
	        <td class="main">
				<?php 
					if(isset($_GET['pID'])) {
						echo xtc_draw_selection_field('products_col_top', 'checkbox', '1', $pInfo->products_col_top==1 ? true : false).TEXT_TEMPLATE_COLUMN_TOP.'<br />';
						echo xtc_draw_selection_field('products_col_left', 'checkbox', '1', $pInfo->products_col_left==1 ? true : false).TEXT_TEMPLATE_COLUMN_LEFT.'<br />'; 
						echo xtc_draw_selection_field('products_col_right', 'checkbox', '1', $pInfo->products_col_right==1 ? true : false).TEXT_TEMPLATE_COLUMN_RIGHT.'<br />';
						echo xtc_draw_selection_field('products_col_bottom', 'checkbox', '1', $pInfo->products_col_bottom==1 ? true : false).TEXT_TEMPLATE_COLUMN_BUTTON.'<br />';
					} else {
						echo xtc_draw_selection_field('products_col_top', 'checkbox', '1', true).TEXT_TEMPLATE_COLUMN_TOP.'<br />';
						echo xtc_draw_selection_field('products_col_left', 'checkbox', '1', true).TEXT_TEMPLATE_COLUMN_LEFT.'<br />'; 
						echo xtc_draw_selection_field('products_col_right', 'checkbox', '1', true).TEXT_TEMPLATE_COLUMN_RIGHT.'<br />';
						echo xtc_draw_selection_field('products_col_bottom', 'checkbox', '1', true).TEXT_TEMPLATE_COLUMN_BUTTON.'<br />';
					}	
				?>
			</td>
		</tr>	  
    </table></td>
    <td valign="top" style="border-left: 1px dashed #ccc">
		<table width="100%" border="0">
		<?php
			if (GROUP_CHECK == 'true') {
				$customers_statuses_array = xtc_get_customers_statuses();
				$customers_statuses_array = array_merge(array (array ('id' => 'all', 'text' => TXT_ALL)), $customers_statuses_array);
		?>
		<tr>
		<td valign="top" class="main" ><?php echo ENTRY_CUSTOMERS_STATUS; ?></td>
		<td class="main">
		<?php
			for ($i = 0; $n = sizeof($customers_statuses_array), $i < $n; $i ++) {
				$code = '$id=$pInfo->group_permission_'.$customers_statuses_array[$i]['id'].';';
				eval ($code);
				if ($id==1) {
					$checked = 'checked ';
				} else {
					$checked = '';
				}
				echo '<input type="checkbox" name="groups[]" value="'.$customers_statuses_array[$i]['id'].'"'.$checked.'> '.$customers_statuses_array[$i]['text'].'<br />';
			}
		?>
		</td>
		</tr>
		<?php } ?>
		</table>
		<table width="100%" border="0">
	        <tr>
	          <td colspan="4"><?php include(DIR_WS_MODULES.'group_prices.php'); ?></td>
	        </tr>
		</table>
	<?php echo TEXT_PRODUCTS_STATUS; ?> <?php echo xtc_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . xtc_draw_radio_field('products_status', '1', $status) . '&nbsp;' . TEXT_PRODUCT_AVAILABLE . '&nbsp;' . xtc_draw_radio_field('products_status', '0', $out_status) . '&nbsp;' . TEXT_PRODUCT_NOT_AVAILABLE; ?><br />
      <table width="100%" border="0">
        <tr>
          <td class="main" width="127"><?php echo TEXT_PRODUCTS_DATE_AVAILABLE; ?><br />
              <small>(YYYY-MM-DD)</small></td>
          <td class="main"><?php echo xtc_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;'; ?>
              <script type="text/javascript">dateAvailable.writeControl(); dateAvailable.dateFormat="yyyy-MM-dd";</script></td>
        </tr>
      </table>
     <br />
    </td>
  </tr>
</table>

<!-- Produkt Filter v2.1 -->
<table width="100%" border="0">
	<tr valign="top">
		<td>
			<?php include (DIR_WS_MODULES.'products_filter.php'); ?>
		</td>
	</tr>
</table>
<!-- Produkt Filter v2.1 END -->
<div id="tabs">
  	<ul>
	    <?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>
	    	<li><a href="#language_<?php echo $i; ?>">
	    		<span><img src="../lang/<?php echo $languages[$i]['directory'].'/'.$languages[$i]['image']; ?>" alt="" /> <?php echo $languages[$i]['name'] ?></span>
	    	</a></li>
	    <?php } ?>
	</ul>
	<?php for ($i = 0, $n = sizeof($languages); $i < $n; $i++) { ?>
		<div id="language_<?php echo $i; ?>">
			<table width="100%" border="0">
				<tr>
					<td width="50%" valign="top">
						<table width="100%" border="0">
						  <tr>
						    <td style="background:#e2e2e2" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;<?php echo TEXT_PRODUCTS_NAME; ?> <?php echo xtc_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : xtc_get_products_name($pInfo->products_id, $languages[$i]['id'])),'style="width:98%"'); ?></td>
						  </tr>
						  <tr>
						    <td style="background:#fafafa" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?>&nbsp;URL Alias<em>(optional)</em> <?php echo ' <a href="#" onclick="javascript:return false;"'.mouseOverJS(HEAD_URL_ALIAS,BODY_URL_ALIAS).'>'.xtc_image(DIR_WS_ICONS.'icon_help.gif').'</a>';  ?>: <?php echo xtc_draw_input_field('products_url_alias[' . $languages[$i]['id'] . ']', (($products_url_alias[$languages[$i]['id']]) ? stripslashes($products_url_alias[$languages[$i]['id']]) : xtc_get_products_url_alias($pInfo->products_id, $languages[$i]['id'])),'style="width:98%"'); ?></td>
						  </tr>
						  <tr>
						    <td class="main"><?php echo TEXT_PRODUCTS_URL . ' <a href="#" onclick="javascript:return false;"'.mouseOverJS(TEXT_PRODUCTS_URL,TEXT_PRODUCTS_URL_WITHOUT_HTTP).'>'.xtc_image(DIR_WS_ICONS.'icon_help.gif').'</a>'; echo xtc_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : xtc_get_products_url($pInfo->products_id, $languages[$i]['id'])),'style="width:98%"0') ?></td>
						  </tr>
						</table>
					</td>
					<td valign="top" align="right" >
						<table width="80%">
							<tr>
								<td valign="top">
					        <?php echo TEXT_PRODUCTS_KEYWORDS; ?><br />
					        <?php echo xtc_draw_input_field('products_keywords[' . $languages[$i]['id'] . ']',(($products_keywords[$languages[$i]['id']]) ? stripslashes($products_keywords[$languages[$i]['id']]) : xtc_get_products_keywords($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?><br />     
					        <?php echo TEXT_META_TITLE; ?><br />
					        <?php echo xtc_draw_input_field('products_meta_title[' . $languages[$i]['id'] . ']',(($products_meta_title[$languages[$i]['id']]) ? stripslashes($products_meta_title[$languages[$i]['id']]) : xtc_get_products_meta_title($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?><br />
					        <?php echo TEXT_META_DESCRIPTION; ?><br />
					        <?php echo xtc_draw_input_field('products_meta_description[' . $languages[$i]['id'] . ']',(($products_meta_description[$languages[$i]['id']]) ? stripslashes($products_meta_description[$languages[$i]['id']]) : xtc_get_products_meta_description($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?><br />
					        <?php echo TEXT_META_KEYWORDS; ?><br />
					        <?php echo xtc_draw_input_field('products_meta_keywords[' . $languages[$i]['id'] . ']', (($products_meta_keywords[$languages[$i]['id']]) ? stripslashes($products_meta_keywords[$languages[$i]['id']]) : xtc_get_products_meta_keywords($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?> <br />
					        <?php echo TEXT_PRODUCTS_GOOGLE_TAXONOMIE; ?><br />
							<?php echo xtc_draw_input_field('products_google_taxonomie[' . $languages[$i]['id'] . ']', (($products_products_google_taxonomie[$languages[$i]['id']]) ? stripslashes($products_products_google_taxonomie[$languages[$i]['id']]) : xtc_get_products_google_taxonomie($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?> <br />
					        <?php echo TEXT_PRODUCTS_TAXONOMIE; ?><br />
							<?php echo xtc_draw_input_field('products_taxonomie[' . $languages[$i]['id'] . ']', (($products_products_taxonomie[$languages[$i]['id']]) ? stripslashes($products_products_taxonomie[$languages[$i]['id']]) : xtc_get_products_taxonomie($pInfo->products_id, $languages[$i]['id'])), 'style="width:98%"'); ?> <br />
					        
							
							
							<script type="text/javascript">
							  <!--
								jQuery(document).ready(function(){
								  jQuery('a.ajax_<?php echo $languages[$i]['id'] ?>').click(function(){
								    jQuery.ajax({
								      type: "POST",
								      url: "includes/javascript/new_input.php",
								      data: {'language':<?php echo $languages[$i]['id'] ?>},
								      success: function(msg){
								        jQuery('#quote_<?php echo $languages[$i]['id'] ?>').fadeIn("slow").append(msg);
								        /*$(location).attr("hash", $(this).attr("hash"));*/
								      }
								    });
								  });
								});
								 //-->
							</script>
							Tag Cloud <?php echo'<a href="#" onclick="javascript:return false;"'.mouseOverJS('Tag Cloud',BODY_TAG).'>'.xtc_image(DIR_WS_ICONS.'icon_help.gif').'</a>'; ?><br />
							<?php
								$data_query = xtc_db_query("SELECT tag FROM tag_to_product WHERE lID = '".$languages[$i]['id']."' AND pID = '".$pInfo->products_id."' ");
								if(xtc_db_num_rows($data_query)) {
									while($data = xtc_db_fetch_array($data_query)) {
										if(!empty($data)) {
											echo xtc_draw_input_field('products_tag_cloud[' . $languages[$i]['id'] . '][]', $data['tag'], 'size=25 maxlenght=50').'<br />';
										}
									}
								} else
									echo xtc_draw_input_field('products_tag_cloud[' . $languages[$i]['id'] . '][]', '', 'size=25 maxlenght=50').'<br />';
							?>
							<div id="quote_<?php echo $languages[$i]['id'] ?>"></div>
							<a class="ajax_<?php echo $languages[$i]['id'] ?>" href="#" onclick="javascript:return false;"><?php echo TEXT_PRODUCTS_TAGCLOUD; ?></a>        
					     </td>
						</tr>
					   </table>
					</td>
				</tr>
			</table>
			<table width="100%" border="0">
			  <tr>
			    <td>
			        <strong><?php echo TEXT_PRODUCTS_DESCRIPTION; ?></strong><br />
			        <?php 
						echo xtc_draw_textarea_field('products_description_' . $languages[$i]['id'], 'soft', '103', '30', (($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : xtc_get_products_description($pInfo->products_id, $languages[$i]['id'])));
						echo xtc_wysiwyg('products_description_' . $languages[$i]['id']);
			 		?>
			    </td>
			    </tr>
			  </table>
			  <table border="0" width="100%">
			  <tr>
			    <td valign="top">
			        <strong><?php echo TEXT_PRODUCTS_SHORT_DESCRIPTION; ?></strong><br />
			        <?php 
						echo xtc_draw_textarea_field('products_short_description_' . $languages[$i]['id'], 'soft', '103', '20', (($products_short_description[$languages[$i]['id']]) ? stripslashes($products_short_description[$languages[$i]['id']]) : xtc_get_products_short_description($pInfo->products_id, $languages[$i]['id'])));
						echo xtc_wysiwyg('products_short_description_' . $languages[$i]['id']);
					?>
			   </td>
			  </tr>
			  <tr>
			    <td valign="top">
			        <strong><?php echo TEXT_PRODUCTS_ZUSATZ_DESCRIPTION; ?></strong><br />
			        <?php 
						echo xtc_draw_textarea_field('products_zusatz_description_' . $languages[$i]['id'], 'soft', '103', '20', (($products_zusatz_description[$languages[$i]['id']]) ? stripslashes($products_zusatz_description[$languages[$i]['id']]) : xtc_get_products_zusatz_description($pInfo->products_id, $languages[$i]['id'])));
						echo xtc_wysiwyg('products_zusatz_description_' . $languages[$i]['id']);
					?>
			   </td>
			  </tr>				  
			</table>
		</div>
	<?php } ?>
	</div><br />
	<h3><?php echo TEXT_PRODUCTS_IMAGES_FLASH; ?></h3>
	<table width="100%" border="0">
		<tr>
			<td width="49%" valign="top">
				<table width="100%" border="0" cellpadding="3">
					<?php include (DIR_WS_MODULES.'products_images.php'); ?>
				</table>
			</td>
			<td width="1%">
				&nbsp;
			</td>
			<td valign="top">
				<table width="100%" border="0" cellpadding="3">
					<tr>
				    	<td class="main"><?php echo TEXT_PRODUCTS_FLASH_UPLOAD; ?><br /></td>
			        	<td class="main">
							<?php echo xtc_draw_file_field('products_movie_on_server'); ?>
						</td>
			    	</tr>
					<?php if ($pInfo->products_movie_on_server != '') { ?>
						<tr>
							<td colspan="2">
								<span class="main"><?php echo TEXT_PRODUCTS_FILE_EXIST; ?> <?php echo DIR_WS_CATALOG_MOVIES.'<strong>'.$pInfo->products_movie_on_server .'</strong>'. xtc_draw_hidden_field('products_previous_movies', $pInfo->products_movie_on_server); ?>
								</span>
							</td>
						</tr>
						<tr>
							<td align="left" class="main" valign="middle">
								<?php echo xtc_draw_selection_field('del_movie', 'checkbox', $pInfo->products_movie_on_server).' '.$pInfo->products_movie_on_server.' '.TEXT_DELETE; ?>?
							</td>
						</tr>
					<?php } ?>
					<tr>
				    	<td class="main"><?php echo TEXT_PRODUCTS_EMBEDDED_FLASH; ?></td>
			        	<td class="main">
							<?php echo xtc_draw_textarea_field('products_movie_embeded_code', 'soft', '1', '5', $pInfo->products_movie_embeded_code,'style="width:90%"'); ?>
						</td>
			    	</tr>
					<tr>
				    	<td class="main"><?php echo TEXT_PRODUCTS_YOUTUBE_ID; ?></td>
			        	<td class="main">
							<?php echo  xtc_draw_input_field('products_movie_youtube_id', $pInfo->products_movie_youtube_id,'style="width:90%"'); ?>
						</td>
			    	</tr>
					<tr>
				    	<td class="main"><?php echo TEXT_PRODUCTS_HEIGHT; ?></td>
			        	<td class="main">
							<?php echo  xtc_draw_input_field('products_movie_height', $pInfo->products_movie_height,'style="width:90%"'); ?>
						</td>
			    	</tr>
					<tr>
				    	<td class="main"><?php echo TEXT_PRODUCTS_WIDTH; ?></td>
			        	<td class="main">
							<?php echo  xtc_draw_input_field('products_movie_width', $pInfo->products_movie_width,'style="width:90%"'); ?>
						</td>
			    	</tr>
				</table>
			</td>
		<tr>
	</table><br />
    <?php
		echo xtc_draw_hidden_field('products_date_added', (($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d')));
		echo xtc_draw_hidden_field('products_id', $pInfo->products_id);
	?>
	<div align="right" style="display:block; text-align:right">
		<input type="submit" class="button" value="<?php echo BUTTON_SAVE; ?>">
	  	&nbsp;&nbsp;
	  	<?php echo '<a class="button" href="' . xtc_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $_GET['pID']) . '">' . BUTTON_CANCEL . '</a>'; ?>
	</div>
</form>